//引入experss模块
const express = require('express');
//引入连接池
const pool = require('../pool');
//创建产品路由器
const product = express.Router();
//创建周边列表的接口
product.get('/product',(req,res)=>{
  let sql ='select productid,productphoto,productphoto1,productphoto2,productphoto3,productphoto4,producttitle,productdesc,productprice,market,evaluate,stock,details1,details2,details3,details4,details5,details6,details7,details8 from tykyo_product order by productid';
  //执行SQL语句
  pool.query(sql,(error,results)=>{
    if(error) throw error;
    res.send({message:'ok',code:200,results:results});
  });
});
module.exports=product;